import request from '@/utils/request'

//获取混凝土台账表格
export function searchLedgerTable(page, pageSize, projectName, subprojectName, keyWord) {
  return request({
    url: `/statementManage2/getConcreteTableProject?page=${page}&pageSize=${pageSize}&projectName=${projectName}&subprojectName=${subprojectName}&keyWord=${keyWord}`,
    method: 'GET'
  })
}

//获取混凝土台账报表
export function searchLedgerPreview(subprojectId, keyWord) {
  return request({
    url: `/statementManage2/getConcretePreview?subprojectId=${subprojectId}&keyWord=${keyWord}`,
    method: 'GET'
  })
}

//获取混凝土见证取样表格
export function searchJianZhengTable(page, pageSize, projectName, subprojectName, keyWord) {
  return request({
    url: `/statementManage2/getJianZhengTableProject?page=${page}&pageSize=${pageSize}&projectName=${projectName}&keyWord=${keyWord}&&subprojectName=${subprojectName}`,
    method: 'GET'
  })
}

//获取混凝土见证取样预览报表
export function searchJianZhengPreview(projectId, subprojectId, keyWord) {
  return request({
    url: `/statementManage2/getJianZhengPreview?projectId=${projectId}&subprojectId=${subprojectId}&keyWord=${keyWord}`,
    method: 'GET'
  })
}

//混凝土试块评定列表
export function searchShiKuaiPingDing(current, size, subprojectName, projectName) {
  return request({
    url:`/statementManage/searchShiKuaiPingDing?page=${current}&pageSize=${size}&subprojectName=${subprojectName}&projectName=${projectName}`,
    method: 'get'
  })
}

//混凝土试块评定详情
export function searchConcreteItem(projectId, subprojectId, stdPassDate, maintCondition, concreteStrength) {
  return request({
    url:`/statementManage/searchConcreteItem?projectId=${projectId}&subprojectId=${subprojectId}&stdPassDate=${stdPassDate}&maintCondition=${maintCondition}&concreteStrength=${concreteStrength}`,
    method: 'get'
  })
}

//混凝土试块温度列表
export function searchConcreteTemperature(current, size, subprojectName, projectName, userPart) {
  return request({
    url:`/statementManage/searchConcreteTemperature?page=${current}&pageSize=${size}&subprojectName=${subprojectName}&projectName=${projectName}&userPart=${userPart}`,
    method: 'get'
  })
}

//混凝土试块温度详情
export function searchConcreteTemperatureItem(dataId) {
  return request({
    url:`/statementManage/searchConcreteTemperatureItem?dataId=${dataId}`,
    method: 'get'
  })
}

// 导出混凝土施工台账（标养/同养）
export function exportConcreteLedgerByTemplate(subprojectId, keyWord, maintType) {
  let url = `/statementManage2/exportConcreteLedgerByTemplate?subprojectId=${subprojectId}`
  if (keyWord) {
    url += `&keyWord=${keyWord}`
  }
  if (maintType !== undefined && maintType !== null) {
    url += `&maintType=${maintType}`
  }
  return request({
    url: url,
    method: 'get',
    responseType: 'blob'
  })
}

// 导出见证取样记录（标养/同养）
export function exportJianZhengByTemplate(projectId, subprojectId, keyWord) {
  return request({
    url: `/statementManage2/exportJianZhengByTemplate?projectId=${projectId}&subprojectId=${subprojectId}&keyWord=${keyWord}`,
    method: 'get',
    responseType: 'blob'
  })
}


